Cn

class Cn(connection: Connection) : Connection(source)

A concrete implementation of the Connection interface that manages a single database connection while ensuring thread-safety and proper lifecycle handling.

This class wraps an R2dbcConnection and provides methods for executing queries, managing transactions, and fetching results. It uses a mutex to synchronize operations and ensures the connection is in the correct state before performing any operations. It tracks the connection's status internally and supports releasing resources appropriately.

Constructors

Link copied to clipboard
constructor(connection: Connection)

Creates an instance of Cn with the specified R2dbcConnection.

Properties

Link copied to clipboard
open override val status: Connection.Status

Functions

Link copied to clipboard
open fun assertIsAcquired()
Link copied to clipboard
open suspend override fun begin(): Result<Transaction>
Link copied to clipboard
open suspend override fun execute(statement: Statement): Result<Long>
open suspend override fun execute(sql: String): Result<Long>
Link copied to clipboard
open suspend fun <T> fetchAll(sql: String, rowMapper: RowMapper<T>): Result<List<T>>
open suspend override fun fetchAll(statement: Statement): Result<ResultSet>
open suspend override fun fetchAll(sql: String): Result<ResultSet>
open suspend override fun <T> fetchAll(statement: Statement, rowMapper: RowMapper<T>): Result<List<T>>
Link copied to clipboard
open suspend override fun release(): Result<Unit>
Link copied to clipboard
open suspend fun <T> transaction(f: suspend Transaction.() -> T): T